cssimage: Don't start a transition if the start and end are the same
authorJasper St. Pierre <jstpierre@mecheye.net>
Sun, 2 Aug 2015 19:35:45 +0000 (12:35 -0700)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sun, 2 Aug 2015 19:57:31 +0000 (12:57 -0700)
Since a lot of Adwaita sets transition: all, it's easy to end up in a
state where we're making dummy transitions for all of the icons, most of
which we'll never be showing.

gtk/gtkcssimage.c

index 2d92829959b839b5ba06324aba1915beba0072b1..31b1e805672ebcb66172c75696435a8e6da106c3 100644 (file)
@@ -87,6 +87,8 @@ gtk_css_image_real_transition (GtkCssImage *start,
     return g_object_ref (start);
   else if (progress >= 1.0)
     return end ? g_object_ref (end) : NULL;
+  else if (_gtk_css_image_equal (start, end))
+    return g_object_ref (start);
   else
     return _gtk_css_image_cross_fade_new (start, end, progress);
 }